import request from '@/utils/request'

// 获取聚合步长列表
export function getStepOptions() {
  return request({
    url: '/dispatch/realtime/step/options',
    method: 'get'
  })
}

// 获取监测项下拉选项
export function getMetricOptions() {
  return request({
    url: '/dispatch/realtime/metric/options',
    method: 'get'
  })
}

// 获取监测点下拉选项
export function getMonitorOptions(params) {
  return request({
    url: '/dispatch/realtime/monitor/options',
    method: 'get',
    params: {
      metricTypeId: params.metricTypeId
    }
  })
}

// 获取实时曲线数据
export function getRealtimeSeries(data) {
  return request({
    url: '/dispatch/realtime/series',
    method: 'post',
    data: {
      monitorCodes: data.monitorCodes,
      start: data.start,
      end: data.end,
      step: data.step
    }
  })
}

// 获取最新值数据
export function getRealtimeLatest(data) {
  return request({
    url: '/dispatch/realtime/latest',
    method: 'post',
    data
  })
}